package com.awcall.iot.controller;


import com.awcall.iot.common.ResponseResult;
import com.awcall.iot.model.VerifCode;
import com.awcall.iot.service.IVerifCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import com.awcall.iot.common.BaseController;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 验证码表 前端控制器
 * </p>
 *
 * @author wuhui
 * @since 2018-03-22
 */
@RestController
@RequestMapping("/admin/verifCode")
public class VerifCodeController extends BaseController {

    @Autowired
    private IVerifCodeService iVerifCodeService;

    @PostMapping("/getVerfiCode")
    public ResponseResult getVerfiCode(@RequestBody VerifCode verifCode){
        return iVerifCodeService.getVerifCode(verifCode.getTelephone(),verifCode.getType());
    }

    @PostMapping("/verfiCode")
    public ResponseResult verfiCode(@RequestBody VerifCode verifCode) {
        return iVerifCodeService.verfiCode(verifCode.getTelephone(), verifCode.getType(), verifCode.getCode());
    }

}
